package cn.sciento.farm.devicemanager.gateway.model.uplink.fertilizer.inject;

import cn.sciento.farm.devicemanager.common.util.NumberUtil;
import lombok.Data;

import java.util.List;

@Data
public class InjectFertilizerWorkStatus {

    private String eui;

    private Integer mode;

    private Integer schedule;

    private WaterPipe waterPipe;

    private FatPipe fatPipe;

    @Data
    public static class WaterPipe{
        private Integer consumption;
    }

    @Data
    public static class FatPipe{
        private List<PipeStatus> variable;
    }


    public static class PipeStatus{
        private Integer consumption;
        private Float totalRatio;

        public Integer getConsumption() {
            return consumption;
        }

        public void setConsumption(Integer consumption) {
            this.consumption = consumption;
        }

        public Float getTotalRatio() {
            return NumberUtil.float2float(totalRatio,2);
        }

        public void setTotalRatio(Float totalRatio) {
            this.totalRatio = totalRatio;
        }
    }

}
